﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConfigDashboard.Models
{
    /// <summary>
    /// Type of message resulting from import process
    /// </summary>
    public enum SpreadsheetImportMessageType
    {
        /// <summary>
        /// Informational message
        /// </summary>
        Information,

        /// <summary>
        /// Error message
        /// </summary>
        Error
    }

    /// <summary>
    /// Message related to import process
    /// </summary>
    public class SpreadsheetImportMessage
    {
        /// <summary>
        /// Gets or sets the type of the message.
        /// </summary>
        /// <value>
        /// The type of the message.
        /// </value>
        public SpreadsheetImportMessageType MessageType { get; set; }

        /// <summary>
        /// Gets or sets the message.
        /// </summary>
        /// <value>
        /// The message.
        /// </value>
        public string Message { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="SpreadsheetImportMessage"/> class.
        /// </summary>
        /// <param name="messageType">Type of the message.</param>
        /// <param name="message">The message.</param>
        public SpreadsheetImportMessage(SpreadsheetImportMessageType messageType, string message)
        {
            MessageType = messageType;
            Message = message;
        }
    }

    /// <summary>
    /// Results from import process
    /// </summary>
    public class SpreadsheetImportResult
    {
        /// <summary>
        /// Gets or sets the records imported successfully.
        /// </summary>
        /// <value>
        /// The records imported successfully.
        /// </value>
        public int SettingNamesImportedSuccessfully { get; set; }

        /// <summary>
        /// Gets or sets the settings imported successfully.
        /// </summary>
        /// <value>
        /// The settings imported successfully.
        /// </value>
        public int SettingsImportedSuccessfully { get; set; }

        /// <summary>
        /// Gets or sets the environments imported successfully.
        /// </summary>
        /// <value>
        /// The environments imported successfully.
        /// </value>
        public int EnvironmentsImportedSuccessfully { get; set; }

        /// <summary>
        /// Gets the messages.
        /// </summary>
        public List<SpreadsheetImportMessage> Messages { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="SpreadsheetImportResult"/> class.
        /// </summary>
        public SpreadsheetImportResult()
        {
            Messages = new List<SpreadsheetImportMessage>();
        }
    }
}
